package com.webAutoTest.common;

import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;

public class paramsUtil {
    private String[] goods = new String[]{"西瓜","水蜜桃","吐鲁番光照充分的好吃的很甜的大葡萄","梨","香蕉","草莓","火龙果"};
    public String  getGoodsname(){
        //随机返回一个水果
        int index = (int)(Math.random()*goods.length);
        System.out.println(index);
        return goods[index];
    }
    /**
     * 返回商品价格：原价+折扣价
     */
    public List<Integer> getPrices(){
        int index = (int)(Math.random()*goods.length);
        int discount = index<1?1:index;
        int price = discount+1;
        List<Integer> list = new ArrayList<>();
        list.add(price);
        list.add(discount);
        return list;
    }

}
